<div class="footer">
    <div class="our_service">
        <div class="box f_l">
            <div class="title">我们的服务</div>
            <div class="menu">
                <ul>
                    <?php if (isset($category) && !empty($category)) { ?>
                        <?php foreach ($category as $key => $val) { ?>
                            <li><a href="<?php echo "/service/" . $val['id'] . ".html"; ?>" target=" _blank">
                                    <p><?php echo $val['category_name']; ?></p>
                                </a></li>
                        <?php } ?>
                    <?php } ?>
                </ul>
            </div>
        </div>
        <div class="box f_r">
            <div class="title">我们的通讯</div>
            <div class="sub">
                <h1>获取关于特色物业电子邮件</h1>
                <h2>
                    <span><input type="text" id="subscribe_mail"></span><a href="javascript:;" id="subscribe">订阅</a>
                </h2>
                <i class="ico"></i>
            </div>
        </div>
    </div>
    <!--    友情链接-->
    <div class="hb">
        <ul>
            <?php if ($links) : ?>
                <?php foreach ($links as $key => $val) : ?>
                    <li><a href="<?php echo $val['url']; ?>"><img src="<?php echo $val['img']; ?>"></a></li>
                <?php endforeach; ?>
            <?php endif; ?>
        </ul>
    </div>
    <div class="copy">
        <p>地址：<?php echo $this->config->item('address'); ?></p>
        <p>电话：<?php echo $this->config->item('telephone'); ?> — 传真：<?php echo $this->config->item('fax'); ?></p>

        <p>&copy; 2019 – First Western Properties版权所有</p>
    </div>
</div>
<script>
    $('.hiSlider1').hiSlider();
    $('.hiSlider2').hiSlider({
        isFlexible: true,
        mode: 'fade',
        isSupportTouch: false,
        isShowTitle: false,
        isShowPage: false,
        titleAttr: function (curIdx) {
            return $('img', this).attr('alt');
        }
    });
    $('.hiSlider3').hiSlider({
        isFlexible: true,
        isSupportTouch: true,
        titleAttr: function (curIdx) {
            return $('img', this).attr('alt');
        }
    });
    $('.hiSlider4').hiSlider({
        startSlide: 1,
        direction: 'top'
    });
    $("#phone_nav").click(function () {
        $(".phone_lis").toggle();
    });

    $("#subscribe").click(function () {

        var email = $("#subscribe_mail").val();
        var reg = /\w+[@]{1}\w+[.]\w+/;
        if (email == '' || email == undefined) {
            layer.alert("请输入email地址");
            return false;
        }
        if (!reg.test(email)) {
            layer.alert("请输入正确的email地址");
            return false;
        }
        var url = "/email_add";
        $.ajax({
            url: url,
            type: "post",
            data: {'email': email},
            dataType: 'json',
            success: function (data) {
                console.log(data);
                if (data.status == 1) {
                    layer.alert("订阅成功", {
                        skin: 'layui-layer-lan'
                        , closeBtn: 1
                        , anim: 5 //动画类型
                    }, function (index) {
                        window.location.href = window.location.href;
                    });
                } else {
                    layer.alert("订阅失败");
                }
            }
        });

    });
</script>
<script>
    var mySwiper = new Swiper('.swiper-container', {
        autoplay: true, //可选选项，自动滑动
        pagination: {
            el: '.swiper-pagination',
            clickable: true,
        },
        navigation: {
            nextEl: '.swiper-button-next',
            prevEl: '.swiper-button-prev',
        },
        autoplay: {
            delay: 4000,
            disableOnInteraction: false,
        },
    })
</script>
</body>
</html>
